Skip to content

fix: restore support for declare option exist:timeout "-1" to disable timeout#6081

Draft
joewiz wants to merge 1 commit intoeXist-db:developfrom
joewiz:fix/issue-2529-timeout-option
Draft

fix: restore support for declare option exist:timeout "-1" to disable timeout#6081
joewiz wants to merge 1 commit intoeXist-db:developfrom
joewiz:fix/issue-2529-timeout-option

Conversation

@joewiz
Copy link
Copy Markdown
Member

@joewiz joewiz commented Mar 3, 2026

Summary

  • Restores the ability to disable query timeouts via declare option exist:timeout "-1" (or "0")
  • setTimeoutFromOption() was missing the <= 0 guard that configureDefaults() already had, causing negative values to be stored directly as the timeout — since elapsed > -1 is always true, queries were immediately terminated
  • Adds XQueryWatchDogTest with 7 unit tests covering positive, zero, negative, invalid, and multi-value timeout options

Fixes #2529

Test plan

  • New XQueryWatchDogTest passes (7/7 tests)
  • Verify declare option exist:timeout "-1"; no longer causes immediate query termination in a running eXist-db instance

🤖 Generated with Claude Code

@joewiz joewiz requested a review from a team as a code owner March 3, 2026 04:20
@joewiz joewiz force-pushed the fix/issue-2529-timeout-option branch 3 times, most recently from 8fab6b7 to 326b637 Compare March 5, 2026 04:38
@joewiz
Copy link
Copy Markdown
Member Author

joewiz commented Mar 5, 2026

Ubuntu CI timeout analysis

The ubuntu-latest unit (Java 21) job has been timing out after 45 minutes on repeated runs of this PR. After investigation, we suspect this is a pre-existing infrastructure issue unrelated to the PR's changes.

Why we suspect this PR isn't the cause:

  1. The PR changes are trivially small: a 3-line if guard in XQueryWatchDog.java and a new unit test file with 7 simple EasyMock-based tests. Nothing that could cause a hang.
  2. The previous run of this exact PR (run 22698232712) had ubuntu unit tests pass in ~16 minutes.
  3. The unit test step runs mvnd test across all modules, so any pre-existing flaky test anywhere in the project can cause the hang.

Why only ubuntu is affected:

The CI matrix excludes Windows and macOS from the unit test type — they only run integration tests. So only ubuntu would exhibit a unit test timeout.

Likely culprit:

Known flaky infrastructure tests like MoveResourceTest and RenameCollectionTest can hang indefinitely on CI runners. Re-running the failed job should resolve the issue.

We welcome other ideas about what might be causing this timeout.

🤖 Co-authored by Claude Code

@duncdrum
Copy link
Copy Markdown
Contributor

duncdrum commented Mar 5, 2026

We should put a hold on this one, until the open xsuite PRs are in. The hang is a concern, imv.

@joewiz joewiz marked this pull request as draft March 5, 2026 14:41
@joewiz
Copy link
Copy Markdown
Member Author

joewiz commented Mar 5, 2026

@duncdrum Sure, makes sense! I've changed this PR to draft to make it clear that we shouldn't merge it in this state.

The other PR of mine showing ubuntu failures despite repeated runs is #6083.

…able timeout

The setTimeoutFromOption() method stored negative values (like -1) directly
as the timeout, causing queries to be immediately terminated since
elapsed > -1 is always true. The configureDefaults() method already handled
this correctly by treating values <= 0 as Long.MAX_VALUE (infinite), but
this guard was missing from setTimeoutFromOption().

Fixes eXist-db#2529

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@joewiz joewiz force-pushed the fix/issue-2529-timeout-option branch from 326b637 to 7c37dd3 Compare April 13, 2026 13:28
@line-o line-o added this to v7.0.0 Apr 24, 2026
@line-o line-o moved this to Backlog in v7.0.0 Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Timeouts can no longer be disabled via option exist:set-timeout

3 participants